package com.ler.yrmall.ware.controller;

import com.ler.yrmall.basic.Result;
import com.ler.yrmall.ware.form.WareSkuForm;
import com.ler.yrmall.ware.service.WareSkuService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Arrays;


/**
 * 仓库信息
 * @author Leron
 */
@RestController
@RequestMapping("/wareSku")
public class WareSkuController {

    @Resource
    private WareSkuService wareSkuService;

    @RequestMapping("/find")
    public Result<?> find(WareSkuForm request) {
        return Result.ok(wareSkuService.find(request));
    }

    @RequestMapping("/delete")
    public Result<?> delete(@RequestBody Long[] ids) {
        wareSkuService.deleteWareSku(Arrays.asList(ids));
        return Result.ok();
    }

}
